VERSION 5.00
Begin VB.Form HIVSummaryForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   2
      Top             =   5160
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      Caption         =   "Save"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   2580
      TabIndex        =   1
      Top             =   3720
      Width           =   1935
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   2580
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   4800
      Width           =   1935
   End
   Begin VB.Label ClientCode_Data 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   3540
      TabIndex        =   12
      Top             =   840
      Width           =   2775
   End
   Begin VB.Label ClientCode_Label 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Client | Couple Code:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1260
      TabIndex        =   13
      Top             =   840
      Width           =   2715
   End
   Begin VB.Label Determine_Label 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Test #1:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1260
      TabIndex        =   11
      Top             =   1320
      Width           =   915
   End
   Begin VB.Line SexColorLine 
      BorderColor     =   &H00FFC0C0&
      BorderWidth     =   10
      X1              =   420
      X2              =   420
      Y1              =   720
      Y2              =   2640
   End
   Begin VB.Label ClientSexLabel 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Client Sex Goes Here"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1020
      TabIndex        =   10
      Top             =   480
      Width           =   2415
   End
   Begin VB.Label Test2Name_Data 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   2580
      TabIndex        =   9
      Top             =   1800
      Width           =   4215
   End
   Begin VB.Label Unigold_Label 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Test #2:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1260
      TabIndex        =   8
      Top             =   1800
      Width           =   915
   End
   Begin VB.Label Test1Name_Data 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   2580
      TabIndex        =   7
      Top             =   1320
      Width           =   4215
   End
   Begin VB.Label Test3Name_Data 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   2580
      TabIndex        =   6
      Top             =   2280
      Width           =   4215
   End
   Begin VB.Label Hemastrip_Label 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Test #3:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1260
      TabIndex        =   5
      Top             =   2280
      Width           =   915
   End
   Begin VB.Label HIVStatus_Data 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   375
      Left            =   2580
      TabIndex        =   4
      Top             =   2760
      Width           =   4215
   End
   Begin VB.Label HIVStatus_Label 
      BackColor       =   &H00C0FFFF&
      Caption         =   "HIV Status:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1260
      TabIndex        =   3
      Top             =   2760
      Width           =   2055
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00000000&
      BorderWidth     =   2
      Height          =   3135
      Left            =   420
      Shape           =   4  'Rounded Rectangle
      Top             =   240
      Width           =   7695
   End
End
Attribute VB_Name = "HIVSummaryForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cancel_Button_Click()
   HIVMenuForm.Show
   Unload Me
End Sub

Private Sub Form_Load()

   If TEST3RESULT = "" Then
      'third test not performed
      If TEST1RESULT = TEST2RESULT Then
         If TEST1RESULT = "0" Then
            HIV = "00"
         Else
            If TEST1RESULT = "1" Then
               HIV = "01"
            Else
               HIV = ""
            End If
         End If
      Else
         HIV = "97"
      End If
   Else
      If TEST3RESULT = TEST1RESULT Then
         If TEST3RESULT = "0" Then
            HIV = "00"
         Else
            If TEST3RESULT = "1" Then
               HIV = "01"
            Else
               HIV = ""
            End If
         End If
      Else
         If TEST3RESULT = TEST2RESULT Then
            If TEST3RESULT = "0" Then
               HIV = "00"
            Else
               If TEST3RESULT = "1" Then
                  HIV = "01"
               Else
                  HIV = ""
               End If
            End If
         Else
            HIV = ""
         End If
      End If
   End If

   If TEST1RESULT = "0" Then
      Test1Name_Data.Caption = TEST1NAME & " is Non-reactive"
   Else
      If TEST1RESULT = "1" Then
         Test1Name_Data.Caption = TEST1NAME & " is Reactive"
      Else
         Test1Name_Data.Caption = "ERROR"
      End If
   End If
   
   If TEST2RESULT = "0" Then
      Test2Name_Data.Caption = TEST2NAME & " is Non-reactive"
   Else
      If TEST2RESULT = "1" Then
         Test2Name_Data.Caption = TEST2NAME & " is Reactive"
      Else
         Test2Name_Data.Caption = "ERROR"
      End If
   End If
      
   If TEST3RESULT = "" Then
      Test3Name_Data.Caption = "Test not performed"
   Else
      If TEST3RESULT = "0" Then
         Test3Name_Data.Caption = TEST3NAME & " is Non-reactive"
      Else
         If TEST3RESULT = "1" Then
            Test3Name_Data.Caption = TEST3NAME & " is Reactive"
         Else
            Test3Name_Data.Caption = "ERROR"
         End If
      End If
   End If
      
   If HIV = "00" Then
      HIVStatus_Data.Caption = "Negative"
   Else
      If HIV = "01" Then
         HIVStatus_Data.Caption = "Positive"
      Else
         If HIV = "97" Then
            HIVStatus_Data.Caption = "Inconclusive"
         Else
            HIVStatus_Data.Caption = "ERROR"
         End If
      End If
   End If
            
   If SEX = "1" Then
      ClientSexLabel.Caption = "Male Client"
      SexColorLine.BorderColor = vbBlue
   Else
      If SEX = "2" Then
         ClientSexLabel.Caption = "Female Client"
         SexColorLine.BorderColor = vbGreen
      Else
         ClientSexLabel.Caption = "ERROR"
         SexColorLine.BorderColor = vbRed
      End If
   End If
   
   If SESSTYPE = "01" Then
      ClientCode_Data.Caption = CLIENTCO & " | n/a"
   Else
      If SESSTYPE = "02" Then
         ClientCode_Data.Caption = CLIENTCO & " | " & COUPCODE
      Else
         ClientCode_Data.Caption = "Error in SESSTYPE"
      End If
   End If
   
End Sub

Private Sub Next_Button_Click()

   'Save the results in the database
   CnUser.Open ConnectString
   Cmd.CommandText = "UPDATE client SET " & _
                     "TEST1NAME = '" & TEST1NAME & "', " & _
                     "TEST1RESULT = '" & TEST1RESULT & "', " & _
                     "TEST2NAME = '" & TEST2NAME & "', " & _
                     "TEST2RESULT = '" & TEST2RESULT & "', " & _
                     "TEST3NAME = '" & TEST3NAME & "', " & _
                     "TEST3RESULT = '" & TEST3RESULT & "', " & _
                     "HIV = '" & HIV & "', " & _
                     "TIMELAB = '" & Format(Now(), "hh:mm:ss") & "', " & _
                     "LABTECH = '" & UserPwd & "' " & _
                     "WHERE VISITID = " & VISITID
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   Cmd.Execute
   CnUser.Close
   
   If ORGANIZATION = "MACRO" Then
      HIVMenuForm.Show
   Else
      If ORGANIZATION = "LIGHTHOUSE" Then
         PretestSummaryForm.Show
      End If
   End If
   Unload Me
   
End Sub

